feat: settlements + financials + admin tokens; fix CSV export (#22) and abort exit code (#24) - #33
feat: settlements + financials + admin tokens; fix CSV export (#22) and abort exit code (#24)#33LucasLeguizamo wants to merge 2 commits into
Conversation
Exports promised "(CSV)" in help but only emitted JSON; wire toCsv into buyers/attendees/subscribers/reconciliation. Add --json to `ft login` and `ft config` and move the login confirmation to stderr so `| jq` stays clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… exit code Sync to B2B contract 1.5.0 + admin 1.1.0 and wire the endpoints that unblock the finance integration: - `ft settlements list` → GET /settlements (issue #32) - `ft reports financials` → GET /reports/financials (issue #32) - `ft admin tokens …` → GET/POST/DELETE /tokens (admin 1.1.0) - `ft events list --q` → new query param in 1.5.0 Fixes: - #22 `reports export reconciliation` answers text/csv, so the payload arrives as a string. Running it through print()/JSON.stringify quoted the whole file and escaped newlines as a literal backslash-n, making the CSV unparseable. String payloads are now written verbatim. - #24 aborting a destructive command exited 0, so `ft … delete && next-step` ran next-step. All four confirmation sites now go through confirmOrExit, which exits 1 on refusal and fails fast (pointing at --yes) with no TTY. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR Summary by QodoAdd settlements, financials & admin PAT; fix CSV export and abort exit code
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTo customize comments, go to the Qodo configuration screen, or learn more in the docs. |
Sincroniza el CLI con el contrato B2B 1.5.0 y admin 1.1.0, y arregla dos bugs reportados.
Fixes
\nliteral.GET /reports/exports/reconciliationrespondetext/csv, así que el payload llega como string. Pasaba porprint()/JSON.stringify, que encomillaba el archivo entero y escapaba los saltos como los dos caracteres\+n. Ahora los payloads string se escriben verbatim. Verificado conod -ccontra la API real: arranca ensale_reference,…sin comilla inicial y con0x0Areales.delete,api-keys revoke,admin … suspend,event-dates delete) pasan porconfirmOrExit: rechazo → exit 1; sin TTY y sin--yes→ falla de inmediato apuntando a--yes, en vez de imprimirAborted.y seguir.Contrato 1.5.0 / admin 1.1.0
ft settlements list—GET /settlements(API: exponer endpoint de settlements/liquidaciones a organizador (monto + comprobante PDF) #32). Nota: el PDF de comprobante sigue siendo solo del panel; el contrato exponehasDocumenty los nombres de archivo, no una URL de descarga.ft reports financials—GET /reports/financials(API: exponer endpoint de settlements/liquidaciones a organizador (monto + comprobante PDF) #32): bruto, cargo de plataforma, facial, comisión de pasarela, 4x1000 y neto a liquidar por función, más el estado de la liquidación. Los mismos números del dashboard de Liquidaciones, así una integración financiera deja de recalcularlos cruzando/salescon Mercado Pago.ft admin tokens list|create|revoke— service tokens de plataforma (PAT) paraft adminheadless en CI.ft events list --q <texto>— búsqueda server-side.Además:
--csvreal en todos losreports exporty--jsonenft login/ft config(commit que había quedado sin mergear).Verificación
pnpm typecheck·pnpm lint·pnpm test(19 tests, 2 archivos nuevos: passthrough de CSV string y exit code del abort) · smoke test en vivo desettlements list,reports financialsy el export de conciliación.Closes #22, closes #24. Avanza #32 (queda pendiente el PDF).
🤖 Generated with Claude Code